import { type } from 'os';
import React, { ReactElement, ReactNode } from 'react';
interface RouteMedia {
    isHide: boolean;
    isDefault?: boolean;
}

export interface IRoute {
    path: string;
    icon: ReactElement | string;
    children: Array<IRoute> | null;
    Element?: React.FC;
    url?: string;
    media?: RouteMedia;
    key: string;
    name: string;
    label?: string;
}

export interface IError {
    error: string;
    message: string[];
    statusCode: number;
}

type MenuData<T, K extends keyof T> = {
    [key in K]: key extends 'children' ? Array<MenuData<T, K>> | null : T[key];
};
export type IMenu = MenuData<
    IRoute,
    'icon' | 'children' | 'key' | 'path' | 'label' | 'name' | 'media'
>;

export interface IResponse<T = any> {
    statusCode: number;
    message: string;
    data?: T;
}
